package it.ebruni.caroid;

import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore.Audio;

public class FileSong {
	
	private String path;
	private String title;
	private String filename;
	private String artist;
	
	public FileSong(Cursor cursor) {
		this.setTitle(cursor.getString(cursor.getColumnIndex(Audio.Media.TITLE)));
		this.setFilename(cursor.getString(cursor.getColumnIndex(Audio.Media.DISPLAY_NAME)));
		this.setArtist(cursor.getString(cursor.getColumnIndex(Audio.Media.ARTIST)));
		int audioId =cursor.getInt( cursor.getColumnIndex(Audio.Media._ID) ); 
		Uri uri = Uri.withAppendedPath( Audio.Media.EXTERNAL_CONTENT_URI,
                Integer.toString(audioId) );
		this.setPath(uri.toString() );
	}
	
	
	/**
	 * @return the path
	 */
	public String getPath() {
		return path;
	}
	/**
	 * @param path the path to set
	 */
	public void setPath(String path) {
		this.path = path;
	}
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}
	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the filename
	 */
	public String getFilename() {
		return filename;
	}
	/**
	 * @param filename the filename to set
	 */
	public void setFilename(String filename) {
		this.filename = filename;
	}
	/**
	 * @return the artist
	 */
	public String getArtist() {
		return artist;
	}
	/**
	 * @param artist the artist to set
	 */
	public void setArtist(String artist) {
		this.artist = artist;
	}
	

}
